	/*
 * Logger.java
 * Copyright November 23, 2012 Erik Strelzoff
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.magelord.utils;

import com.magelord.servlet.MageLordServletContext;

/**
 * Static utility for logging messages in the MageLord system.
 *<p>
 * Implemented to log messages to the Servlet Context.
 *
 */
public class Logger {
	
	/**
	 * The underlying servlet context being written to.
	 */
	private static MageLordServletContext m_servletContext;
	
	/**
	 * Not instantiable.
	 */
	private Logger() {
	}
	
	public static void setContext(MageLordServletContext context) {
		m_servletContext = context;
	}
	
	public static void debug(String msg) {
		m_servletContext.log(msg);
	}
	
	public static void error(String msg) {
		m_servletContext.log(msg);
	}
	
	public static void error(String msg, Throwable t) {
		m_servletContext.log(msg, t);
	}
}
